var Helloworld = cc.Layer.extend({
    isMouseDown: false,
    isKeyDown: true,
    keys: {},
    init: function() {
        var selfPointer = this;

        this._super();

        var winsize = cc.Director.getInstance().getWinSize();

        dino.map.read("snow", this);

        // var tree = dino.create('tree');
        // tree.setPosition(cc.p(winsize.width / 2, winsize.height / 2))
        // this.addChild(tree);
        this.setKeyboardEnabled(true);
        return true;

    },
    onKeyDown: function(e) {
        dino.keys[e] = true;
        console.log(e);
    },
    onKeyUp: function(e) {
        dino.keys[e] = false;
    }


});
var HelloWorldScene = cc.Scene.extend({
    onEnter: function() {
        this._super();
        var layer = new Helloworld();
        layer.init();
        this.addChild(layer);
    }
});